import request from '../../utils/request'
//获取购物车数据
export const reqGetCartListData = () => {
  return request({
    url: '/mall-api/cart/getCartList'
  })
}
//添加商品到购物车
export const reqAddGoodsToCart = ({
  goodsId,
  count,
  blessing
}) => {
  return request({
    url: `/mall-api/cart/addToCart/${goodsId}/${count}`,
    data: {
      blessing
    }
  })
}
//购物车全选状态的切换
export const reqCheckAllCartStatus = (isChecked) => {
  return request({
    url: `/mall-api/cart/checkAllCart/${isChecked}`
  })
}

//删除购物车商品
export const reqDelteCartInfo = (goodsId) => {
  return request({
    url: `/mall-api/cart/delete/${goodsId}`
  })
}

//单选或者不选状态的切换
export const reqCheckCartInfoStatus = ({
  goodsId,
  isChecked
}) => {
  return request({
    url: `/mall-api/cart/checkCart/${goodsId}/${isChecked}`
  })
}